package com.xiaohong.user.fallback;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xiaohong.user.feign.ChatUserFeign;
import com.xiaohong.user.pojo.User;
import entity.Result;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Component
public class ChatUserFallback implements ChatUserFeign {
    /***
     * 分页条件搜索实现ChatUser
     * @param user
     * @param page
     * @param size
     * @return
     */
    public Result<Page> findPage(@RequestBody(required = false) User user, @PathVariable int page, @PathVariable  int size){
        System.out.println("ChatUserFallback的findPage方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+ user +"和"+page+"和"+size);
        return null;
    };

    /***
     * 分页搜索实现ChatUser
     * @param page:当前页
     * @param size:每页显示多少条
     * @return
     */
    public Result<Page> findPage(@PathVariable  int page, @PathVariable  int size){
        System.out.println("ChatUserFallback的findPage方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+page+"和"+size);
        return null;
    }

    /***
     * 多条件搜索ChatUser数据
     * @param user
     * @return
     */
    public Result<List<User>> findList(@RequestBody(required = false) User user){
        System.out.println("ChatUserFallback的findList方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+ user);
        return null;
    }

    /***
     * 根据Id删除chatUser数据
     * @param id
     * @return
     */
    public Result delete(@PathVariable Long id){
        System.out.println("ChatUserFallback的delete方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+id);
        return null;
    }

    /***
     * 根据ID修改ChatUser数据
     * @param user
     * @return
     */
    public Result update(@RequestBody User user){
        System.out.println("ChatUserFallback的update方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+ user );
        return null;
    }

    /***
     * 新增ChatUser数据
     * @param user
     * @return
     */
    public Result add(@RequestBody User user){
        System.out.println("ChatUserFallback的add方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+ user);
        return null;
    }

    /***
     * 根据ID查询ChatUser数据
     * @param id
     * @return
     */
    public Result<User> findById(@PathVariable Long id){
        System.out.println("ChatUserFallback的findById方法错误，错误日志已保存数据库了哦");
        System.out.println("数据:"+id);
        return null;
    }

    /***
     * 查询ChatUser全部数据
     * @return
     */
    public Result<List<User>> findAll(){
        System.out.println("ChatUserFallback的findAll方法错误，错误日志已保存数据库了哦");
        return null;
    }
}
